// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   MiniFormatter.java

package org.quickserver.util.logging;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.*;
import org.quickserver.util.MyString;

public class MiniFormatter extends Formatter
{

    public MiniFormatter()
    {
    }

    public String format(LogRecord record)
    {
        Date date = new Date();
        date.setTime(record.getMillis());
        StringBuilder sb = new StringBuilder();
        sb.append(df.format(date));
        sb.append(" - ");
        sb.append(MyString.alignLeft(record.getLevel().getLocalizedName(), 7));
        sb.append(" : ");
        sb.append(formatMessage(record));
        if(record.getThrown() != null)
        {
            sb.append(lineSeparator);
            sb.append("[Exception: ");
            sb.append(record.getThrown().toString());
            sb.append(']');
        }
        sb.append(lineSeparator);
        return sb.toString();
    }

    private final SimpleDateFormat df = new SimpleDateFormat("MMM d, yyyy HH:mm a");
    private final String lineSeparator = System.getProperty("line.separator");
}
